package poly;

public class RobotPet extends Pet{
    int a;
    public RobotPet(String name, String masterName) {
        super(name, masterName,5);
    }
    public void introduce(){
        System.out.println("我是机器人。名字是"+getName()+"。");
        System.out.println("我的主人是"+getMasterName()+"。" );
    }
    public void work(int sw){
        switch(sw){
            case 0:
                System.out.println("扫地");break;
            case 1:
                System.out.println("洗衣");break;
            case 2:
                System.out.println("做饭");break;
        }
        System.out.println("...");
        a =1;
    }
}
